extends Node2D

const ResetDash := preload("uid://iosjf8t63ods")

@export var generate_time:float = 3.0

var current_reset:Node2D = null

func _ready() -> void:
	generate()
	var timer: = Timer.new()
	timer.wait_time = generate_time
	timer.autostart = true
	timer.timeout.connect(generate)
	add_child(timer)


func generate() -> void:
	if current_reset == null:
		var instance = ResetDash.instantiate()
		current_reset = instance
		add_child(instance)
		instance.tree_exited.connect(generate)
	
